<?php

namespace common\models\buss;

use Yii;

/**
 * This is the model class for table "{{%buss_tool_water}}".
 *
 * @property int $id
 * @property int $project_id 项目ID
 * @property int $type 类型【1文字、2图片】
 * @property string $file 文件【type=2】
 * @property string $text 文字【type=1】
 * @property int $alpha 透明度【20-80区间，单位：%】
 * @property int $created_member_id 创建人ID
 * @property int $operation_id 操作人ID
 * @property string $operation_name 操作人
 * @property int $status 状态【-1：删除; 0：禁用; 1：启用】
 * @property int $created_at 创建时间
 * @property int $updated_at 更新时间
 */
class ToolWater extends \common\models\base\BaseModel
{
    const TYPE_TEXT = 1;
    const TYPE_FILE = 2;

    const STATUS_DELETE = -1;// 删除
    const STATUS_INVALID = 0;// 禁用
    const STATUS_ENABLE = 1;// 正常

    public static $types = [
        self::TYPE_TEXT => '文字',
        self::TYPE_FILE => '图片',
    ];

    public static $statuss = [
        self::STATUS_DELETE => '删除',
        self::STATUS_INVALID => '停用',
        self::STATUS_ENABLE => '正常',
    ];

    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%buss_tool_water}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['project_id', 'type', 'alpha', 'created_member_id', 'operation_id', 'status', 'created_at', 'updated_at'], 'integer'],
            [['file', 'text', 'operation_name'], 'string', 'max' => 64],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'project_id' => '项目ID',
            'type' => '类型【1文字、2图片】',
            'file' => '文件【type=2】',
            'text' => '文字【type=1】',
            'alpha' => '透明度【20-80区间，单位：%】',
            'created_member_id' => '创建人ID',
            'operation_id' => '操作人ID',
            'operation_name' => '操作人',
            'status' => '状态【-1：删除; 0：禁用; 1：启用】',
            'created_at' => '创建时间',
            'updated_at' => '更新时间',
        ];
    }
}
